package Gui;

import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

public class ventanaPrincipal extends javax.swing.JFrame {

    /** Creates new form ventanaPrincipal */
    public ventanaPrincipal() {
        initComponents();
        this.setLocationRelativeTo(null);
        fondoVenta.setVisible(false);
        fondoBaseDatos.setVisible(false);
        fondoFacturacion.setVisible(false);
        fondoMantenimiento.setVisible(false);
        fondoPublicidad.setVisible(false);
        fondoReportes.setVisible(false);
        fondoVallas.setVisible(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        botonVenta = new javax.swing.JLabel();
        botonMantenimiento = new javax.swing.JLabel();
        botonPublicidad = new javax.swing.JLabel();
        botonVallas = new javax.swing.JLabel();
        botonBaseDatos = new javax.swing.JLabel();
        botonFacturacion = new javax.swing.JLabel();
        botonReportes = new javax.swing.JLabel();
        fondoVenta = new javax.swing.JLabel();
        fondoMantenimiento = new javax.swing.JLabel();
        fondoPublicidad = new javax.swing.JLabel();
        fondoVallas = new javax.swing.JLabel();
        fondoBaseDatos = new javax.swing.JLabel();
        fondoFacturacion = new javax.swing.JLabel();
        fondoReportes = new javax.swing.JLabel();
        fondo = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Kioscos AO - Sistema de administración de kioscos");
        setResizable(false);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        botonVenta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                botonVentaMouseClicked(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                botonVentaMouseExited(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                botonVentaMouseEntered(evt);
            }
        });
        botonVenta.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                botonVentaFocusGained(evt);
            }
        });
        getContentPane().add(botonVenta, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 130, 250, 60));

        botonMantenimiento.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                botonMantenimientoMouseClicked(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                botonMantenimientoMouseExited(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                botonMantenimientoMouseEntered(evt);
            }
        });
        botonMantenimiento.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                botonMantenimientoFocusGained(evt);
            }
        });
        getContentPane().add(botonMantenimiento, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 210, 250, 60));

        botonPublicidad.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                botonPublicidadMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                botonPublicidadMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                botonPublicidadMouseExited(evt);
            }
        });
        botonPublicidad.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                botonPublicidadFocusGained(evt);
            }
        });
        getContentPane().add(botonPublicidad, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 280, 250, 60));

        botonVallas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                botonVallasMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                botonVallasMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                botonVallasMouseExited(evt);
            }
        });
        botonVallas.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                botonVallasFocusGained(evt);
            }
        });
        getContentPane().add(botonVallas, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 350, 250, 60));

        botonBaseDatos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                botonBaseDatosMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                botonBaseDatosMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                botonBaseDatosMouseExited(evt);
            }
        });
        botonBaseDatos.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                botonBaseDatosFocusGained(evt);
            }
        });
        getContentPane().add(botonBaseDatos, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 420, 250, 60));

        botonFacturacion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                botonFacturacionMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                botonFacturacionMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                botonFacturacionMouseExited(evt);
            }
        });
        botonFacturacion.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                botonFacturacionFocusGained(evt);
            }
        });
        getContentPane().add(botonFacturacion, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 500, 250, 60));

        botonReportes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                botonReportesMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                botonReportesMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                botonReportesMouseExited(evt);
            }
        });
        botonReportes.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                botonReportesFocusGained(evt);
            }
        });
        getContentPane().add(botonReportes, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 570, 250, 60));

        fondoVenta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/BotonVenta.jpg"))); // NOI18N
        getContentPane().add(fondoVenta, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        fondoMantenimiento.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/AdminGUIMantenimiento.jpg"))); // NOI18N
        getContentPane().add(fondoMantenimiento, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        fondoPublicidad.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/AdminGUIPublicidad.jpg"))); // NOI18N
        getContentPane().add(fondoPublicidad, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        fondoVallas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/AdminGUIVallas.jpg"))); // NOI18N
        getContentPane().add(fondoVallas, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        fondoBaseDatos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/AdminGUIBasedeDatos.jpg"))); // NOI18N
        getContentPane().add(fondoBaseDatos, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        fondoFacturacion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/AdminGUIFacturacion.jpg"))); // NOI18N
        getContentPane().add(fondoFacturacion, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        fondoReportes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/AdminGUIReportes.jpg"))); // NOI18N
        getContentPane().add(fondoReportes, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        fondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/AdminGUI.jpg"))); // NOI18N
        getContentPane().add(fondo, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void botonVallasFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_botonVallasFocusGained
        
}//GEN-LAST:event_botonVallasFocusGained

private void botonVallasMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonVallasMouseEntered
    fondoVallas.setVisible(true);
}//GEN-LAST:event_botonVallasMouseEntered

private void botonVallasMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonVallasMouseExited
    fondoVallas.setVisible(false);
}//GEN-LAST:event_botonVallasMouseExited

private void botonVentaMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonVentaMouseEntered
    fondoVenta.setVisible(true);
}//GEN-LAST:event_botonVentaMouseEntered

private void botonVentaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonVentaMouseExited
    fondoVenta.setVisible(false);
}//GEN-LAST:event_botonVentaMouseExited

private void botonVentaFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_botonVentaFocusGained

}//GEN-LAST:event_botonVentaFocusGained

private void botonMantenimientoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonMantenimientoMouseEntered
    fondoMantenimiento.setVisible(true);
}//GEN-LAST:event_botonMantenimientoMouseEntered

private void botonMantenimientoMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonMantenimientoMouseExited
// TODO add your handling code here:
    fondoMantenimiento.setVisible(false);
}//GEN-LAST:event_botonMantenimientoMouseExited

private void botonMantenimientoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_botonMantenimientoFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_botonMantenimientoFocusGained

private void botonPublicidadMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonPublicidadMouseEntered
    fondoPublicidad.setVisible(true);
}//GEN-LAST:event_botonPublicidadMouseEntered

private void botonPublicidadMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonPublicidadMouseExited
// TODO add your handling code here:
    fondoPublicidad.setVisible(false);
}//GEN-LAST:event_botonPublicidadMouseExited

private void botonPublicidadFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_botonPublicidadFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_botonPublicidadFocusGained

private void botonBaseDatosMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonBaseDatosMouseEntered
// TODO add your handling code here:
    fondoBaseDatos.setVisible(true);
}//GEN-LAST:event_botonBaseDatosMouseEntered

private void botonBaseDatosMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonBaseDatosMouseExited
// TODO add your handling code here:
    fondoBaseDatos.setVisible(false);
}//GEN-LAST:event_botonBaseDatosMouseExited

private void botonBaseDatosFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_botonBaseDatosFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_botonBaseDatosFocusGained

private void botonFacturacionMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonFacturacionMouseEntered
// TODO add your handling code here:
    fondoFacturacion.setVisible(true);
}//GEN-LAST:event_botonFacturacionMouseEntered

private void botonFacturacionMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonFacturacionMouseExited
// TODO add your handling code here:
    fondoFacturacion.setVisible(false);
}//GEN-LAST:event_botonFacturacionMouseExited

private void botonFacturacionFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_botonFacturacionFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_botonFacturacionFocusGained

private void botonReportesMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonReportesMouseEntered
// TODO add your handling code here:
    fondoReportes.setVisible(true);
}//GEN-LAST:event_botonReportesMouseEntered

private void botonReportesMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonReportesMouseExited
// TODO add your handling code here:
    fondoReportes.setVisible(false);
}//GEN-LAST:event_botonReportesMouseExited

private void botonReportesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_botonReportesFocusGained
// TODO add your handling code here:
}//GEN-LAST:event_botonReportesFocusGained

private void botonVentaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonVentaMouseClicked
try {
            new VentaKioscosGUI().setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(AdminGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_botonVentaMouseClicked

private void botonPublicidadMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonPublicidadMouseClicked
try {
            new PublicidadGUI().setVisible(true);
        } catch (SQLException ex) {
            System.out.println(ex);
        }
}//GEN-LAST:event_botonPublicidadMouseClicked

private void botonMantenimientoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonMantenimientoMouseClicked
        try {
            new ManejoMantenimientoGUI("M").setVisible(true);
        } catch (SQLException ex) {
            System.out.println(ex);
        }
}//GEN-LAST:event_botonMantenimientoMouseClicked

private void botonVallasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonVallasMouseClicked
        try {
            new ManejoMantenimientoGUI("V").setVisible(true);
        } catch (SQLException ex) {
            System.out.println(ex);
        }
}//GEN-LAST:event_botonVallasMouseClicked

private void botonBaseDatosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonBaseDatosMouseClicked
        try {
            new BaseDatosGUI().setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(AdminGUI.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println("Error en la conexion");
        }
}//GEN-LAST:event_botonBaseDatosMouseClicked

private void botonFacturacionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonFacturacionMouseClicked
        try {
            FacturacionGUI facturacion = new FacturacionGUI();
            facturacion.setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(ventanaPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_botonFacturacionMouseClicked

private void botonReportesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botonReportesMouseClicked
    
    ReportesGUI reportes = new ReportesGUI();
    reportes.setLocationRelativeTo(null);
    reportes.setVisible(true);

}//GEN-LAST:event_botonReportesMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ventanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ventanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ventanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ventanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new ventanaPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel botonBaseDatos;
    private javax.swing.JLabel botonFacturacion;
    private javax.swing.JLabel botonMantenimiento;
    private javax.swing.JLabel botonPublicidad;
    private javax.swing.JLabel botonReportes;
    private javax.swing.JLabel botonVallas;
    private javax.swing.JLabel botonVenta;
    private javax.swing.JLabel fondo;
    private javax.swing.JLabel fondoBaseDatos;
    private javax.swing.JLabel fondoFacturacion;
    private javax.swing.JLabel fondoMantenimiento;
    private javax.swing.JLabel fondoPublicidad;
    private javax.swing.JLabel fondoReportes;
    private javax.swing.JLabel fondoVallas;
    private javax.swing.JLabel fondoVenta;
    // End of variables declaration//GEN-END:variables
}
